import Vue from 'vue'
import Router from 'vue-router'
import Home from "../components/Home";
import Classify from "../components/Classify";
import Personal from "../components/Personal";
import shopCat from "../components/shopCat";
import Special from "../components/Special";
import Hello from "../components/Hello";
import ImgLoder from "../components/ImgLoder";
Vue.use(Router)

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

export default new Router({
  routes: [
    {
      path: '/',
      component:Home
    },
    {
      path: '/home',
      name: 'Home',
      component: Home
    },
    {
      path: '/classify',
      name: 'Classify',
      component: Classify
    },
    {
      path: '/personal',
      name: 'Personal',
      component: Personal
    },
    {
      path: '/shopCat',
      name: 'shopCat',
      component: shopCat
    },
    {
      path: '/special',
      name: 'Special',
      component: Special,
    children:[{
      path: '/hello',
      name: 'Hello',
      component: Hello
    },
{
  path: '/imgloder',
  name: 'ImgLoder',
  component: ImgLoder
}]
    }
  ]
})
